<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>修改菜单</title>
		<link rel="stylesheet" href='<c:url value="/share/pintuer.css"></c:url>'>
		<link rel="stylesheet" href='<c:url value="/share/admin.css"></c:url>' >
		<script type="text/javascript" src='<c:url value="/js/jquery.js"></c:url>' ></script>
		<script type="text/javascript" src='<c:url value="/js/pintuer.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/admin.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/layer.js"></c:url>'></script>
	</head>

	<body>
			<form method="post" action="<c:url value='/adminMenu/editMenu'></c:url>">
				<input type="hidden" name="id" value="${menuMap.id}">
				<c:if test="${menuMap.p_id !=0 }">
				<div class="form-group">
				<div class="label"><label for="parent_id">上级菜单</label></div>
				<div class="field">
					<select class="input input-small" id="p_id" name="p_id">
					<c:forEach items="${firstMenuList}" var="m">
					<c:if test="${m.id == menuMap.p_id}">
						<option value="${m.id}" selected="selected">${m.name}</option>
					</c:if>
					<c:if test="${m.id != menuMap.p_id}">
						<option value="${m.id}" >${m.name}</option>
					</c:if>
					</c:forEach>
					</select>
				</div>
				</div>
				</c:if>
				
				<div class="form-group">
				<div class="label"><label for="subject">菜单名称</label></div>
				<div class="field"><input type="text" class="input input-small"
					id="subject" name="name" value="${menuMap.name}" size="30" data-validate="required:请填写菜单名" />
				</div>
				</div>
				<c:if test="${menuMap.p_id != 0}">
				<div class="form-group">
				<div class="label"><label for="function">方法</label></div>
				<div class="field"><input type="text" class="input input-small"
					id="function" name="function" value="${menuMap.function}" size="30" data-validate="required:必填" />
				</div>
				</div>
				</c:if>
				
				
				<div class="form-group">
				<div class="label"><label for="sort">排序</label></div>
				<div class="field"><input type="text" class="input input-small"
					id="sort" name="sort" value="${menuMap.sort}" size="30" /></div>
				</div>
				
				
				<div class="form-button">
				<button class="button border-green" type="submit">修改</button>
				</div>
			</form>
	</div>
		<script>
			$(function() {
				
				//大于移动端800宽度才弹出提示
				if ($(window).width() >= 800) {
					layer.open({
						type: 1,
						shade: false,
						title: false, //不显示标题
						area: ['420px', '640px'],
						content: $('#alert-talk'), //捕获的元素
						cancel: function(index) {
							layer.close(index);
						}
					});
				}
			});
		</script>
	</body>

</html>